//
//  ItemButton.m
//  AffectionBee
//
//  Created by 李通 on 16/8/18.
//  Copyright © 2016年 chivalrous. All rights reserved.
//

#import "ItemButton.h"


@implementation ItemButton


- (void)layoutSubviews {
    [super layoutSubviews];
    
    CGFloat x = self.bounds.size.width / 2;
    CGFloat y = self.bounds.size.height / 2 - self.bounds.size.width / 2 + 5;
    
    if (_itemLocation == YES) {
        
        x = -5;
    }
    self.titleLabel.frame = CGRectMake(x, self.bounds.size.height - 15, self.bounds.size.width - 15, self.titleLabel.bounds.size.height);
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.imageView.frame = CGRectMake(x + 3, y, self.bounds.size.width / 2, self.bounds.size.height / 2);
}

@end
